﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Masterchitiet : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["giohang"] != null)
        {
            DataTable dt = new DataTable();
            dt = (DataTable)Session["giohang"];
            System.Decimal tongThanhTien = 0;
            foreach (DataRow r in dt.Rows)
            {
                r["Thanhtien"] = Convert.ToInt32(r["SoLuong"]) * Convert.ToDecimal(r["Dongia"]);
                tongThanhTien += Convert.ToDecimal(r["Thanhtien"]);
                lbTongThanhTien.Text = tongThanhTien.ToString();
            }
        }
    }

    protected void bttimlsp_Click(object sender, EventArgs e)
    {
        Response.Redirect("timtheodanhmuc.aspx?timtheodanhmuc=" + ddldanhmuc.SelectedItem.Value);
    }
    protected void bttnhansp_Click(object sender, EventArgs e)
    {
        //Response.Redirect("timtheonhomsp.aspx?timtheonhomsp=" + ddlnhomsp.SelectedItem.Value);
    }
    protected void bttimtensp_Click1(object sender, ImageClickEventArgs e)
    {
        //Response.Redirect("timtheosanpham.aspx?timtheosanpham=" + ddlnhomsp.SelectedItem.Value);
    }
    protected void CmdTim1_Click(object sender, EventArgs e)
    {
        Response.Redirect("sanphamtheoten.aspx?tensp=" + TxtTim.Text);
    }
}
